import com.hbl.hhb.User;
import org.apache.commons.lang3.RandomStringUtils;

import java.lang.reflect.Method;

public class APPhhb {
    public static void main(String[] args) throws Exception{
        //String s = RandomStringUtils.randomAlphabetic(6);
       // System.out.println(s);

        User a=new User();
        a.setName("hhh");
        System.out.println(a.getName());
        a.setAge("19");
        System.out.println(a.getAge());

        Class<?>zz= Class.forName("com.hbl.hhb.User");
        Object o = zz.newInstance();//Ctrl+Alt+v 自动生成左边内容

        Method setName = zz.getMethod("setName", String.class);
        setName.invoke(o,"Jenkins");

        Method getName = zz.getMethod("getName");
        Object result=getName.invoke(o);
        System.out.println(result);
    }
}
